package com.ecommerce.dal.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ecommerce.dal.dao.impl.RankDAO;
import com.ecommerce.dal.entity.Rank;
import com.ecommerce.dal.service.IRankManagerService;

@Service("rankManagerService")
public class RankManagerService implements IRankManagerService {

	@Autowired
	RankDAO rankDAO;

	@Override
	public Rank retrieveRank(int rankId) {
		return rankDAO.findByRankId(rankId);
	}

	@Override
	public void saveRank(Rank rank) {
		rankDAO.save(rank);

	}

	@Override
	public List<Rank> retrieveAllRanks() {
		return rankDAO.findAllRanks();
	}

	@Override
	public void updateRank(Rank rank) {
		rankDAO.update(rank);

	}

	@Override
	public void deleteRank(Rank rank) {
		rankDAO.delete(rank);

	}

}
